<div class="box box-maxbid">
    <div class="box-header">
        <h3 class="box-title">Comitentes Cadastro / Edi&ccedil;&atilde;o</h3>
    </div><!-- /.box-header -->
    <!-- form start -->

    <div class="overlay" ng-show="hideform"></div>
    <div class="loading-img" ng-show="hideform"></div>

    <form role="form" name="ComitenteForm" >
        <div class="box-body">
            <div class="form-group row">
                <div class="col-xs-2" ng-show="imageSeller">
                    <div class="small-box bg-gray image-leilao">
                        <div class="inner box-inner-image-leilao">
                            <input type="hidden" name="LOGO"  value="{{files[0].name}}"/>
                            <img  class="" ng-src="<?php echo web_dir(); ?>images/comitentes/{{files[0].name}}"  width="100%"/>
                            <a href="javascript:void(0)" title="remover imagem" class="btn delete-image-leilao btn-danger btn-sm"
                               ng-click="onDeleteImageSeller(files[0].name)"><i class="fa fa-trash-o"></i></a>

                        </div>
                    </div>
                </div>

                <div class="col-md-4 col-xs-4">
                    <label for="InputTipo" >Nome fantasia</label>
                    <input ng-model="comitente.NOME_FANTASIA" name="NOME_FANTASIA"   
                           required  class="form-control"/>
                    <div class="messages-alert" ng-show="ComitenteForm.NOME_FANTASIA.$dirty && ComitenteForm.NOME_FANTASIA.$invalid">
                        <span ng-show="ComitenteForm.NOME_FANTASIA.$error.required">* Campo requerido</span>
                    </div>
                </div>
                <div class="col-md-5 col-xs-5">
                    <label for="InputTipo" >Raz&atilde;o Social</label>
                    <input ng-model="comitente.RAZAO" name="RAZAO"   
                           required  class="form-control"/>
                    <div class="messages-alert" ng-show="ComitenteForm.RAZAO.$dirty && ComitenteForm.RAZAO.$invalid">
                        <span ng-show="ComitenteForm.RAZAO.$error.required">* Campo requerido</span>
                    </div>
                </div>
                <div class="col-md-3 col-xs-4">
                    <label for="InputTipo" >CNPJ</label>
                    <input ng-model="comitente.CNPJ" name="CNPJ"   
                           required  class="form-control"
                           ui-mask="99.999.999/9999-99"
                           />
                    <div class="messages-alert" ng-show="ComitenteForm.CNPJ.$dirty && ComitenteForm.CNPJ.$invalid">
                        <span ng-show="ComitenteForm.CNPJ.$error.required"> * Campo requerido</span>
                    </div>
                </div>
                <!--
                <div class="col-md-2 col-xs-4">
                    <label for="InputTipo" >IE</label>
                    <input ng-model="comitente.IE" name="IE"   
                           class="form-control"
                           maxlength="15"
                           />
                    <div class="messages-alert" ng-show="ComitenteForm.IE.$dirty && ComitenteForm.IE.$invalid">
                        <span ng-show="ComitenteForm.IE.$error.required"> * Campo requerido</span>
                    </div>
                </div>
                -->
            </div>
            <div class="form-group row">
                <div class="col-md-2 col-xs-3">
                    <label for="InputTipo" >Contato</label>
                    <input ng-model="comitente.REPRESENTANTE" name="REPRESENTANTE"   
                           class="form-control"/>

                </div>
                <div class="col-md-2 col-xs-3">
                    <label for="InputTipo" >CPF Contato</label>
                    <input ng-model="comitente.CPF_REPRESENTANTE" name="CPF_REPRESENTANTE"   
                           class="form-control"
                           ui-mask="999.999.999-99"
                           maxlength="15"
                           />
                </div>
                <div class="col-md-2 col-xs-3">
                    <label for="InputTel" >Telefone</label>
                    <input ng-model="comitente.TELEFONE" name="TELEFONE"   
                           class="form-control"
                           ui-mask="(99)9999-9999"
                           required


                           />
                </div>
                <div class="col-md-2 col-xs-3">
                     <?php echo form_label('FONE/FAX'); ?>
                     <?php echo form_input('FONE_FAX','','ng-model="comitente.FONE_FAX" ui-mask="(99)9999-9999" class="form-control"'); ?>
                </div>
                <div class="col-md-2 col-xs-3">
                    <label for="InputTel" >Celular</label>
                    <input ng-model="comitente.CELULAR" name="CELULAR"   
                           class="form-control"
                           ui-mask="(99)99999-9999"


                           />
                </div>

            </div>
            <div class="row">
                <div class="form-group col-xs-6">
                    <?php echo form_label('RESPONSÁVEL'); ?>
                    <?php echo form_input('RESPONSAVEL','','ng-model="comitente.RESPONSAVEL" class="form-control"'); ?>
                </div>
                 <div class="form-group col-xs-6">
                    <?php echo form_label('EMAIL'); ?>
                    <?php echo form_input('EMAIL','','ng-model="comitente.EMAIL" class="form-control"'); ?>
                </div>
            </div>
            
            <div class="row">
                <div class="form-group col-xs-12">
                    <?php echo form_label('OBSERVAÇÃO'); ?>
                    <?php echo form_input('OBSERVACAO','','ng-model="comitente.OBSERVACAO" class="form-control"'); ?>
                </div>
                 
            </div>
            <hr/>

            <div class="form-group row">
                <div class="col-md-2 col-xs-3">
                    <label for="InputTipo" >CEP</label>
                    <input ng-model="comitente.CEP" name="CEP"   
                           class="form-control"
                           ng-change="setLogradouro()"
                           ui-mask="99999-999"
                           />

                </div>
                <div class="col-md-5 col-xs-8">
                    <label for="InputTipo" >Logradouro</label>
                    <input ng-model="comitente.LOGRADOURO" name="LOGRADOURO"   
                           class="form-control disabled"
                           maxlength="15"
                           disabled="true"
                           />
                </div>
                <div class="col-md-1 col-xs-2">
                    <label for="InputTipo" >Numero</label>
                    <input ng-model="comitente.NUMERO" name="NUMERO"   
                           class="form-control "
                           maxlength="10"

                           />
                </div>
                <div class="col-md-2 col-xs-3">
                    <label for="InputTipo" >Complemento</label>
                    <input ng-model="comitente.COMPLEMENTO" name="COMPLEMENTO"   
                           class="form-control "
                           maxlength="10"

                           />
                </div>

            </div>

            <div class="form-group row">
                <div class="col-md-3 col-xs-4">
                    <label for="InputTipo" >Bairro</label>
                    <input ng-model="comitente.BAIRRO" name="BAIRRO"   
                           class="form-control"
                           disabled="true"
                           />

                </div>
                <div class="col-md-3 col-xs-4">
                    <label for="InputTipo" >Cidade</label>
                    <input ng-model="comitente.CIDADE" name="CIDADE"   
                           class="form-control"
                           maxlength="20"
                           disabled="true"
                           />
                </div>
                <div class="col-md-1 col-xs-2">
                    <label for="InputTipo" >Estado</label>
                    <input ng-model="comitente.UF" name="UF"   
                           class="form-control "
                           maxlength="10"
                           disabled="true"

                           />
                </div>


            </div>

        </div><!-- /.box-body -->

        <div class="box-footer">
            <button type="submit" ng-click="save()" ng-disabled="ComitenteForm.$invalid" class="btn btn-primary">Salvar</button>
            <button type="submit" ng-click="save('true')"  ng-disabled="ComitenteForm.$invalid" class="btn btn-primary">Salvar e Listar</button>
            <a href="#/seller" class="btn btn-danger">Listar</a>
            <span class="separator"></span>
            <a href="javascript:void(0)" ng-click="triggerButton()" class="btn btn-info"><i class="fa fa-picture-o"></i> Upload Logo</a>
            <div class="row">
                <div ng-show="startProgressBar" class="col-xs-12" style="margin-top:10px;">
                    <div class="progress xs comitente-progress-bar">
                        <div class="progress-bar progress-bar-light-blue" style="width:{{progress}}%;"></div>
                    </div>
                </div>
                <upload-button  action="/api/fileSeller" complete="uploadedSeller($data, $status)"></upload-button>
            </div>
        </div>
    </form>
</div><!-- /.box -->

